package com.sls.sys.service.impl;

import java.util.List;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.google.gson.Gson;
import com.sls.core.common.CommonUtil;
import com.sls.sys.dao.MenuDAO;
import com.sls.sys.pojo.PermissionInfoVO;
import com.sls.sys.querybean.MenuQuery;
import com.sls.sys.service.MenuService;

@Service("menuService")
public class MenuServiceImpl implements MenuService {
	@Resource(name = "menuDAO")
	MenuDAO menuDAO;
	Gson gson = CommonUtil.gson();

	@Override
	public List<PermissionInfoVO> buildMenuLv1(String body) {
		MenuQuery query = gson.fromJson(body, MenuQuery.class);
		return menuDAO.buildMenuLv1(query);
	}

	@Override
	public List<PermissionInfoVO> buildMenuLv2(String body) {
		MenuQuery query = gson.fromJson(body, MenuQuery.class);
		return menuDAO.buildMenuLv2(query);
	}

	@Override
	public List<PermissionInfoVO> buildMenuLv3(String body) {
		MenuQuery query = gson.fromJson(body, MenuQuery.class);
		return menuDAO.buildMenuLv3(query);
	}

	@Override
	public List<PermissionInfoVO> queryNotMenu(String body) {
		MenuQuery query = gson.fromJson(body, MenuQuery.class);
		return menuDAO.queryNotMenu(query);
	}

}
